<template>
	<div>

		<!--头部开始-->
		<myheader />
		<!--头部结束-->

		<!--表单区域-->

		<div class="udlite-container partners">

		<van-cell-group>


			<van-field v-model="username" label="用户名" placeholder="请输入用户名"  />

			<van-field v-model="password" label="密 码" placeholder="请输入密码"  />



			<van-field v-model="password1" label="确认密码" placeholder="请输入确认密码"  />


			<van-button type="primary" @click="submit" >注 册</van-button>

			<van-button type="info" >重 置</van-button>


		</van-cell-group>

		</div>

		<!--表单区域-->


	</div>
</template>

<script type="text/javascript">

import myheader from './myheader.vue'

	export default{

		data(){

			return{

				username:"",
				password:"",
				password1:"",
				active: 2
			
				
			}

		},
		//声名组件
		components:{

			'myheader':myheader

		},
		mounted:function(){

		

		},
		//自定义方法
		methods:{
		
			submit:function(){


				if(this.username == ""){

					this.$toast("请填写用户名");
					return false;
				}

				//请求后端接口
				this.axios.get('http://localhost:8000/register/',{params:{username:this.username,password:this.password}}).then((res) =>{

					console.log(res);

					if(res.data.code == 200){

						this.$toast("注册成功");
					}else{
						this.$toast(res.data.message);
					}

				});
				
			}
		}


	};
	


</script>

<style type="text/css">
	

</style>